require "pathname"

puts File.expand_path __FILE__
puts File.dirname(File.expand_path(__FILE__))
puts

pn = Pathname.new(File.dirname(File.expand_path(__FILE__)))

pn.each_entry { |e| 
  puts e
}

puts (1..100).inject(0) { | sum, i | sum + i }

def subclasses_of(superclass)
  subclasses = []
  ObjectSpace.each_object(Class) do |k|
    next if !k.ancestors.include?(superclass) || superclass == k || 
      k.to_s.include?("::") || subclasses.include?(k.to_s)
    subclasses << k
  end
  subclasses
end

puts subclasses_of(Numeric)